﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CgSilverlightDynamicGeometry;

namespace CgPipeSectionDisplay
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnResize_Click(object sender, RoutedEventArgs e)
        {
            CoordinatePanel1.RenderTransform = new ScaleTransform
            {
                ScaleX = (ScrollViewer1.ActualWidth - this.ScrollViewer1.Padding.Left - this.ScrollViewer1.Padding.Right
                - CoordinatePanel1.Margin.Left - CoordinatePanel1.Margin.Right-6) / CoordinatePanel1.ActualWidth
            };
            CoordinatePanel1.Width = this.ScrollViewer1.ActualWidth - this.ScrollViewer1.Padding.Left - this.ScrollViewer1.Padding.Right
                -CoordinatePanel1.Margin.Left-CoordinatePanel1.Margin.Right-6;
        }

        private void btnRestore_Click(object sender, RoutedEventArgs e)
        {
            CoordinatePanel1.RenderTransform = null;
        }
    }
}
